<script>
	import initData from "./common/initData.js";
	import config from "./common/config.js";
	import sharederTools from "./common/sharederTools.js";
	import common from "./common/common.js";
	export default {
		globalData: {
			sceneValue: '', //小程序的场景值
		},
		onLaunch: function(options) {
			if(options.query) { //用于首次进入，且无法获取链接参数
				this.$common.setAppQuery(options.query);
			}
			/* uni.showModal({
				title: "操作提示", content: JSON.stringify(options)
			}) */
			//console.log("------AppVue场景值：------", scene)
			let shareId = sharederTools.checkShare(options.query); //如果options.query中存在sharederId，则保存
			// console.log(process.uniEnv.baseUrl);
			console.log('App Launch', shareId);
			
			initData.initOpenid(); //初始获取openid
			// initData.init(); //这里加了之后会每次都执行，挪到first页面去调用
			// console.log(process.uniEnv.reqUrl)
			// console.log(process.uniEnv.uploadUrl)
			/* initData.init(shareId).then((baseConfig) => {
				// console.log(baseConfig)
				// console.log("==================")
				this.globalData.baseConfig = baseConfig;
			}); */ //初始化数据，设置标题
		},
		onShow: function(options) {
			// console.log('App Show'+"====="+config.BASE_BG_COLOR)
			//console.log("App.vue->onShow", options)
			const scene = options.scene;
			this.globalData.sceneValue = scene; //赋值场景值
		},
		created() {
			console.log("---app created---------")
			this.initMethod();
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {
			initMethod() {
				console.log("====app initMethod====")
			}
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import url("./app.scss");
	@import '@/static/fonts/iconfont.css';
	@import url("./style/mainStyle.css");
</style>
